import socket


class SocketService:
    def __init__(self, host="10.11.122.75", port=10011):
        self.host = host
        self.port = port

    def service(self):
        self.service = socket.socket()
        self.service.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        self.service.bind((self.host, self.port))
        self.service.listen(5)
        return self.service

    def __del__(self):
        self.service.close()
